<?php
class ReadArticlePresenter {
	private $contentRepository;
	private $view;
	public function __construct($view, IArticleRepository $contentRepository) {
		$this->view = $view;
		$this->contentRepository = $contentRepository;
	}
	public function postComment(Comment $comment) {
		if ($comment->getContent () == NULL || trim ( $comment->getContent () ) === 0) {
			$this->view->postCommentFailed ( "Empty string? Well, how would you like to suck my balls then? " );
			return;
		}
		
		$comment->setContent ( trim ( $comment->getContent () ) );
		
		$this->contentRepository->addComment ( $comment );
		
		$this->view->postCommentSucceed ();
	}
	public function deleteComment($commentId) {
		$comment = new Comment ( NULL, NULL, NULL, NULL );
		
		$comment->setId ( $commentId );
		$this->contentRepository->removeComment ( $comment );
		$this->view->deleteCommentSucceed ();
	}
}

?>